<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php echo $this->breadCrumbs(); ?>
  </div>
  <?php if (isset($error_warning)) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/tax.png" alt="" /> <?php echo $_['heading_title']; ?></h1>
      <div class="buttons">
	  <a href="<?php echo UA('localisation/tax_rate/insert'); ?>" class="button"><?php echo $_['button_insert']; ?></a>
	  <a onclick="$('form').submit();" class="button"><?php echo $_['button_delete']; ?></a></div>
    </div>
    <div class="content">
      <form action="<?php echo UA('localisation/tax_rate/delete'); ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td class="left">
                <a <?php echo sort_url('tr.name', true); ?>><?php echo $_['column_name']; ?></a>
               </td>
              <td class="right">
                <a <?php echo sort_url('tr.rate'); ?>><?php echo $_['column_rate']; ?></a>
              </td>
              <td class="left">
                <a <?php echo sort_url('tr.type'); ?>><?php echo $_['column_type']; ?></a>
              </td> 
              <td class="left">
                <a <?php echo sort_url('gz.name'); ?>><?php echo $_['column_geo_zone']; ?></a>
              </td>                         
              <td class="left">
                <a <?php echo sort_url('tr.date_added'); ?>><?php echo $_['column_date_added']; ?></a>
               </td>      
              <td class="left">
                <a <?php echo sort_url('tr.date_modified'); ?>><?php echo $_['column_date_modified']; ?></a>
              </td>                                                                                                                
              <td class="right"><?php echo $_['column_action']; ?></td>
            </tr>
          </thead>
          <tbody>
            <?php if ($tax_rates) { ?>
            <?php foreach ($tax_rates as $tax_rate) { ?>
            <tr onmouseover="this.className='on';" onmouseout="this.className='';">
              <td style="text-align: center;">
                <input type="checkbox" name="selected[]" value="<?php echo $tax_rate['tax_rate_id']; ?>" />
              </td>
              <td class="left"><?php echo $tax_rate['name']; ?></td>
              <td class="right"><?php echo $tax_rate['rate']; ?></td>
              <td class="left"><?php echo ($tax_rate['type'] == 'F') ? $_['text_amount'] : $_['text_percent']; ?></td>
              <td class="left"><?php echo $tax_rate['geo_zone']; ?></td>
              <td class="left"><?php echo v5_date_format($tax_rate['date_added']); ?></td>
              <td class="left"><?php echo v5_date_format($tax_rate['date_modified']); ?></td>
              <td class="right">
                [ <a href="<?php echo UA('localisation/tax_rate/update', 'tax_rate_id=' . $tax_rate['tax_rate_id']); ?>"><?php echo $_['text_edit']; ?></a> ]
              </td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="9"><?php echo $_['text_no_results']; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<?php echo $footer; ?>